#ifndef __QUEUE_H /* 头文件保护 */
#define __QUEUE_H /* 头文件保护 */
#include "common.h"

typedef struct {
    CHAR* data;   
    void *attr;  
    UINT32 size;   
} QUEUE_DATA_T;

typedef struct
{
    UINT32 wPt;
    UINT32 rPt;

    UINT32 size;
    UINT32 dataSize;
    UINT32 attrSize;

    UINT8 isEmpty;
    UINT8 isFull;
    UINT8 valid;
    QUEUE_DATA_T *dataQueue;

}QUEUE_DESC;
INT32 queue_init (QUEUE_DESC *pQueueDesc ,INT32 attrSize ,INT32 queueSize , INT32 dataSize);
void  queue_destroy (QUEUE_DESC *pQueueDesc);
INT32 queue_read(QUEUE_DESC *pQueueDesc , void *attr ,CHAR *data);
INT32 queue_write(QUEUE_DESC *pQueueDesc, void *attr ,CHAR *data, UINT32 size);
void  queue_clean(QUEUE_DESC *pQueueDesc);
CHAR* queue_query(QUEUE_DESC *pQueueDesc, void *attr ,UINT32 *size);
void queue_rmmove(QUEUE_DESC *pQueueDesc);
UINT32 queue_curDataSize(QUEUE_DESC *pQueueDesc);
/******************************** 头文件保护结尾 *****************************/
#endif /* __MSG_CORE_H *//* 头文件保护 */
/******************************** 头文件结束 *********************************/
